package com.atguigu.gmall.product.controller;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.serviceutil.service.OssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2025/10/22 4:03
 */
@RestController
@RequestMapping("admin/product")
public class FileController {
    @Autowired
    private OssService ossService;
    //fileUpload
    @PostMapping("/fileUpload")
    public Result fileUpload(MultipartFile file) throws Exception {
        String ossUrl = ossService.fileUpload(file);
        return Result.ok(ossUrl);
    }
    public Result dev(String file){
        System.out.println("dev分支测试");
        return Result.ok();
    }
    public Result devb(String str){
        System.out.println("devb分支提交");
        return Result.ok();
    }
}
